import zrender from 'zrender/zrender'
import Star from 'zrender/graphic/shape/Star'

const width = 400

export default {
  mounted() {
    const zr = zrender.init(this.$refs.chart)
    const shape = new Star({
      shape: {
        x : width / 2 + 100,
        y : 320,
        r : 70,
        n : 5,
      },
      style: {
        lineJoin : 'round',
        brushType : 'both',
        color : 'green',
        stroke: 'red',
        lineWidth : 10,
        text :'n角星',
        textPosition :'inside'
      },
      draggable : true
    })
    zr.add(shape)
  },

  render(h) {
    return (
      <div class="page">
        <div ref="chart" style="width: 100%; height: 600px"></div>
      </div>
    )
  }
}
